{template 'header', $module}
<div class="menus">
	<table cellpadding="0" cellspacing="0">
		<tr>
			<td class="tab" id="renew"><a href="{$MODULE[2][linkurl]}renew.php"><span>续费</span></a></td>
			<td class="tab_nav">&nbsp;</td>
			<td class="tab" id="renew_auth"><a href="{$MODULE[2][linkurl]}renew.php?action=auth"><span>权限</span></a></td>
		</tr>
	</table>
</div>
<!--{if $action != 'auth'}-->
<form method="post" action="renew.php" onsubmit="return check();">
	<table class="data-form">
		<tr>
			<th width="90">服务费用</th>
			<td class="tr"><strong class="cred">{$MG[fee]}</strong>{$DT[money_unit]}/年</td>
		</tr>
		<tr>
			<th width="90">到期时间</th>
			<td class="tr">{$todate} ({$havedays}天剩余)</td>
		</tr>
		<tr>
			<th width="90"><span class="cred">*</span> 续费年限</th>
			<td class="tr">
				<select name="year" id="year" onchange="Dd('payment').innerHTML = this.value*{$MG[fee]}+'{$DT[money_unit]}';">
					<option value="1">1年</option>
					<option value="2">2年</option>
					<option value="3">3年</option>
				</select>
			</td>
		</tr>
		<tr>
			<th width="90">账户余额</th>
			<td class="tr f_b f_blue">{$_money}{$DT[money_unit]}</td>
		</tr>
		<tr>
			<th width="90">应付总额</th>
			<td class="tr f_b cred" id="payment">{$MG[fee]}{$DT[money_unit]}</td>
		</tr>
		<tr>
			<th width="90"><span class="cred">*</span> 支付密码</th>
			<td class="tr">{template 'password', 'chip'}</td>
		</tr>
		<tr>
			<th width="90"></th>
			<td class="tr" height="50"><input type="submit" name="submit" value=" 确 定 " class="btn"/></td>
		</tr>
	</table>
</form>
<!--{else}-->
<table class="data-form">
	<tr>
		<th width="90">会员级别</th>
		<td class="tr">{$MG[groupname]}</td>
	</tr>

	<tr>
		<th width="90">收费模式</th>
		<td class="tr">{if $MG[fee_mode]}<span class="cred">包年</span>{else}<span class="f_green">免费</span>{/if}</td>
	</tr>

	<tr>
		<th width="90">年 费</th>
		<td class="tr">{if $MG[fee]}<span class="cred"><strong>{$MG[fee]}</strong> {$DT[money_unit]}/年</span>{else}--{/if}</td>
	</tr>
	<tr>
		<th width="90">收件箱</th>
		<td class="tr">
			{if $MG[inbox_limit] == -1}
			0
			{elseif $MG[inbox_limit] == 0}
			不限
			{else}
			{$MG[inbox_limit]}
			{/if}
		</td>
	</tr>

	<tr>
		<th width="90">站内信</th>
		<td class="tr">
			{if $MG[message_limit] == -1}
			0
			{elseif $MG[message_limit] == 0}
			不限
			{else}
			{$MG[message_limit]}
			{/if}
		</td>
	</tr>

	<tr>
		<th width="90">询价</th>
		<td class="tr">
			{if $MG[inquiry_limit] == -1}
			0
			{elseif $MG[inquiry_limit] == 0}
			不限
			{else}
			{$MG[inquiry_limit]}
			{/if}
		</td>
	</tr>

	<tr>
		<th width="90">报价</th>
		<td class="tr">
			{if $MG[price_limit] == -1}
			0
			{elseif $MG[price_limit] == 0}
			不限
			{else}
			{$MG[price_limit]}
			{/if}
		</td>
	</tr>

	<tr>
		<th width="90">好友</th>
		<td class="tr">
			{if $MG[friend_limit] == -1}
			0
			{elseif $MG[friend_limit] == 0}
			不限
			{else}
			{$MG[friend_limit]}
			{/if}
		</td>
	</tr>

	<tr>
		<th width="90">提醒</th>
		<td class="tr">
			{if $MG[alert_limit] == -1}
			0
			{elseif $MG[alert_limit] == 0}
			不限
			{else}
			{$MG[alert_limit]}
			{/if}
		</td>
	</tr>

	<tr>
		<th width="90">收藏</th>
		<td class="tr">
			{if $MG[favorite_limit] == -1}
			0
			{elseif $MG[favorite_limit] == 0}
			不限
			{else}
			{$MG[favorite_limit]}
			{/if}
		</td>
	</tr>
</table>
<!--{/if}-->
<script type="text/javascript">
	<!--{if $action=='auth'}-->
		m('renew_auth');
	<!--{else}-->
		m('renew');
	<!--{/if}-->
	function check() {
		if ( Dd('year').value * {$MG[fee]} > {$_money} ) {
			if ( confirm('账户余额不足，是否现在充值？') ) window.location = 'charge.php?action=pay';
			return false;
		}
		if ( Dd('password').value.length < 6 ) {
			alert('请填写支付密码');
			Dd('password').focus();
			return false;
		}
		return confirm('确定要续费' + Dd('year').value + '年吗？');
	}
</script>
{template 'footer', $module}